/**
 * 
 */
package cx3k.GUI;

import javax.swing.*;
import java.awt.*;
/**
 * @author Chris
 *
 */
public class YearPane extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ScheduledSemester semesters[];
	private SemesterPane mySemesters[];
	
	public static final int FALL = 0;
	public static final int WINTER = 1;
	public static final int SPRING = 2;
	public static final int SUMMER1 = 3;
	public static final int SUMMER2 = 4;
	
	public YearPane(AcademicYear year) {
		this.setBackground(MainWindow.MAINCOLOR);
		GridBagLayout gbl = new GridBagLayout();
		GridBagConstraints gbc = new GridBagConstraints();
		this.setLayout(gbl);
		this.semesters = (ScheduledSemester[]) year.getSemesters().toArray();
		this.mySemesters = new SemesterPane[semesters.length];
		
		for (int i = 0; i<semesters.length; i++) {
			mySemesters[i] = new SemesterPane(semesters[i]);
		}
		
		gbc.fill = GridBagConstraints.BOTH; 
		gbc.anchor = GridBagConstraints.LINE_START; 
		gbc.insets = new Insets(5, 5, 5, 5);
		gbc.gridy = 0; 
		gbc.gridwidth = 1; 
		gbc.gridheight = 1; 
		gbc.weightx = 100/mySemesters.length; 
		gbc.weighty = 100; 	
			
		for (int i = 0; i<mySemesters.length; i++) {
			gbc.gridx = i;
			gbl.setConstraints(mySemesters[i], gbc);
			this.add(mySemesters[i]); 
		}
		
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
